// 11/04/2009 Dennis
// Control class that all other controls/widgets are based on
// has simple properties that most likely all controls will need
class Control
{
  float x, y;
  int width, height;
  color backcolor;
  color forecolor;
  color bordercolor;
  color highlightcolor;
  Control parent;
  PFont font = font1;
  int fontsize = 12;
  
  public int getX()
  {
    return (int)(parent == null ? x : x + parent.getX());
  }
  
  public int getY()
  {
    return (int)(parent == null ? y : y + parent.getY());
  }
  
  public void draw()
  {
  }
  
  public boolean getEvent(int mx, int my, int mstate)
  {
    return false;
  }
  
  public boolean mouseOver(int mx, int my)
  {
    return mx >= 0 && mx < width && my >= 0 && my < height;
  }
}
